<?php
	try
	{
		$pdo = new PDO('mysql:host=localhost;dbname=lamp166;charset=utf8','root','');
	}
	catch(PDOException $e)
	{
		die('数据库连接错误：原因：'.$e->getMessage());
	}

	$sql = "SELECT * FROM district WHERE upid=?";
	// $sql = "INSERT INTO district VALUE(null,?,?,?)";
	// $stmt->bindValue(1,'li4');
	// $stmt->bindValue(2,'18');
	// $stmt->bindValue(3,1);

	$stmt = $pdo->prepare($sql);	//编译预处理语句

	$stmt->bindValue(1,$_POST['upid']);

	$stmt->execute();

	$list = $stmt->fetchAll(PDO::FETCH_ASSOC);

	echo json_encode($list);

